﻿<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="jpath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
	<script type="text/javascript" src="${jpath}/static/page/js/jquery-3.3.1.min.js"></script>
	<script type="text/javascript" src="${jpath}/static/page/js/bootstrap.min.js"></script>
	<script src="${jpath}/static/assets/js/jquery.mobile.custom.min.js"></script>
		<!-- basic styles -->
		<link href="${jpath}/static/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="${jpath}/static/assets/css/font-awesome.min.css" />

		<link rel="stylesheet" href="${jpath}/static/assets/css/ace.min.css" />
		<link rel="stylesheet" href="${jpath}/static/assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="${jpath}/static/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="${jpath}/static/plugins/webuploader/css/webuploader.css" />
		<link rel="stylesheet" href="${jpath}/static/plugins/webuploader/style.css" />

	
		<script src="${jpath}/static/assets/js/ace-extra.min.js"></script>
		<script src="${jpath}/static/plugins/webuploader/dist/webuploader.js"></script>
		<script src="${jpath}/static/plugins/webuploader/upload.js"></script>
		<script type="text/javascript">
			var jpath = "${jpath}";
		</script>
		<script src="${jpath}/js/system_plugins.js"></script>
	<link rel="stylesheet" type="text/css" href="${jpath}/static/page/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="${jpath}/static/page/css/cpsc.css">
	<title>产品上传</title>

	
</head>

<body style="background-image: url(${jpath}/static/page/img/bj.png);background-size: 100% 100%;background-repeat: no-repeat;padding-bottom: 40px;">
	<div class="bj">
		<div class="container top">
			<div class="row">
			<div class="col-xs-2">
				<a style="font-size: 1rem;color: black;" href="${jpath}/page/zy">
				<img src="${jpath}/static/page/img/back.png"></a></div>
			<div class="col-xs-8">产品上传</div> 
			<div class="col-xs-1"></div>     
		 </div>
	</div>
	<div class="kuang">				
		<div class="container">
			<div class="row">
				   <div class="col-xs-12"><span class="shuxian">|</span> &nbsp;产品简介</div>   
			</div>
		<form id="stuForm" method="post">
			<div class="row">
				<div class="col-xs-4">产品名称:</div>
				<div class="col-xs-8"><input type="text" name="bt" id="bt" placeholder="请输入产品名称" name=""></div>   
			</div>
			<div class="row">
				<div class="col-xs-4">产品金额:</div>
				<div class="col-xs-8 "><input type="text" name="je" id="je" placeholder="请输入产品金额" name=""></div>   
			</div>
			<div class="row">
				<div class="col-xs-4">金融机构:</div>
				<div class="col-xs-8 "><input type="text" name="jrjg" id="jrjg" placeholder="请输入金融机构" name=""></div>   
			</div>
			<div class="row">
				<div class="col-xs-4">办理条件:</div>
				<div class="col-xs-8"><textarea rows="5" name="tj" id="tj" style="resize: none;" placeholder="请输入办理条件"></textarea></div>   
			</div>	
			<div class="row">
				<div class="col-xs-4">办理流程:</div>
				<div class="col-xs-8"><textarea rows="5" name="lc" id="lc" style="resize: none;" placeholder="请输入办理流程"></textarea></div>   
			</div>	
			<div class="row">
				<div class="col-xs-4">办理简介:</div>
				<div class="col-xs-8"><textarea rows="5" name="jj" id="jj" style="resize: none;" placeholder="请输入办理简介"></textarea></div>   
			</div>					   	
			<div class="row">
				<div class="col-xs-12"><span class="shuxian">|</span> &nbsp;关于我们</div>   
			</div>
			<div class="row">
				<div class="col-xs-4">公司规模:	</div>
				<div class="col-xs-8"><input type="text" name="gsgm" id="gsgm" placeholder="请输入公司规模"  name=""></div>   
			</div>
			<div class="row">
				<div class="col-xs-4">联系电话:</div>
				<div class="col-xs-8"><input type="text" name="lxwm" id="lxwm"  placeholder="请输入联系电话" name=""></div>   
			</div>
			<div class="row">
				<div class="col-xs-4">发布时间:</div>
				<div class="col-xs-8"><input type="date" name="cpfbsj" id="cpfbsj" ></div> 
			</div>
			<div class="row">
				<div class="col-xs-12"><span class="shuxian">|</span> &nbsp;图片上传</div>   
			</div>
			<div class="row">
				<div class="space-4"></div>		
				<div class="form-gr0oup">
					<label class="col-sm-3 control-label no-padding-right" for="form-field-3"> 产品图片</label>
					<div class="col-sm-9">
						<input type="hidden" name="fujianId" id="fujianId" />
						<div id="wrapper" style="width:250px; margin-left:0px;">
					        <div id="container">
					            	<!--头部，相册选择和格式选择-->
					            <div id="uploader">
					                <div class="queueList" style="padding-top:0px;">
					                    <div id="dndArea" class="placeholder">
					                        <div id="filePicker"></div>
					                        <p>或将图片拖到这里</p>
					                    </div>
					                </div>
					                <div class="statusBar" style="display:none;">
					                    <div class="progress">
					                        <span class="text">0%</span>
					                        <span class="percentage"></span>
					                    </div><div class="info"></div>
					                    <div class="btns">
					                        <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
					                    </div>
					                </div>
					            </div>
					        </div>
					    </div>
					 </div>
				</div>	
			</div>
			<div class="row">
				<div class="col-xs-6 right"><button class="anniu">保存预览</button></div>
				<div class="col-xs-6 left"><button class="btn btn-info" id="subBtn" type="button">
							<i class="icon-ok bigger-110"></i>
							保存
						</button></div>  
			</div>
		</form>
	</div>
	</div>
	</div>
	<script type="text/javascript">
		
		function del(_this){
			var a=$(_this);
			a.parent().parent().remove();
		} 

			function getForm(_form){
				var dataJson = "";
				var dataArr = [];
				$(_form).find("input").each(function(index,_this){
					var iptName = $(_this).attr("name");
					if(iptName != "" && iptName != null){
						dataArr.push(iptName+":'"+$(_this).val()+"'");
						dataJson+=",";
					}
				});
				
				var hymcName = $("#tj").attr("name");
				var seletName = $("#lc").attr("name");
				var jjName = $("#jj").attr("name");
				dataArr.push(seletName+":'"+$("#lc").val()+"'");
				dataArr.push(jjName+":'"+$("#jj").val()+"'");
				dataArr.push(hymcName+":'"+$("#tj").val()+"'");
				dataJson ="{"+ dataArr.join(",")+"}";
				var jsonForms = eval('('+ dataJson +')');
				return jsonForms;
		};
		$(function(){

			$("#subBtn").click(function(){
				if(confirm("确认添加")){
					var jsonForms = getForm("#stuForm");
					console.log(jsonForms);
					$.post("${jpath}/chanping/manager/addcp",jsonForms,function(data){
						console.log(data);
						var json = $.parseJSON(data);
						alert(json.resMsg);
					});
					$("#stuForm input").val("");
				}
			});
		});
	
	</script>
</body>
</html>